﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace BCMongoEntity.TMS.Location.Branches
{
    public class BranchesLocationEntity
    {
        private double longitude;
        private double latitude;

        [JsonIgnore]
        [BsonElement("_id")]
        public ObjectId Id { get; set; }

        /// <summary>
        /// 代理商网点配置Id
        /// </summary>
        [BsonElement("AgentBranchesConfigId")]
        public long AgentBranchesConfigId { get; set; }

        /// <summary>
        /// 代理商网点名称
        /// </summary>
        [BsonElement("AgentBranchesName")]
        public string AgentBranchesName { get; set; }

        /// <summary>
        /// 所在位置精度
        /// </summary>
        [BsonElement("Longitude")]
        public double Longitude { get { return this.longitude; } set { this.longitude = Math.Round(value, 8); } }
        /// <summary>
        /// 所在位置维度
        /// </summary>
        [BsonElement("Latitude")]
        public double Latitude { get { return this.latitude; } set { this.latitude = Math.Round(value, 8); } }
        /// <summary>
        /// 所在位置精维度
        /// </summary>
        [BsonElement("Coordinate")]
        public double[] Coordinate { get; set; }

        /// <summary>
        /// 是否寄送
        /// </summary>
        [BsonElement("IsSend")]
        public bool IsSend { get; set; }

        /// <summary>
        /// 是否收件
        /// </summary>
        [BsonElement("IsReceive")]
        public bool IsReceive { get; set; }
    }
}
